const Index = {
    // 存储数据用的对象
    data : {
        btnHome : document.querySelector("#btnHome"),
        searchWord : document.querySelector("#searchWord"),
        loading : document.querySelector("#loading"),
    },
    // 用来存储函数的对象
    func : {
        init : function(){
            window.onload = function(){
                // console.log("页面加载完成");
                setTimeout(function(){
                    loading.style.display = "none";
                    console.log("页面加载完成");
                }, 3000);
            }

            document.onreadystatechange = function(){
                if(document.readyState == "complete"){
                    setTimeout(function(){
                        loading.style.display = "none";
                        console.log("加载完成");
                    }, 3000);
                }
                else{
                    loading.style.display = "block";
                }
            }
        },
        clickHome : function(){
            console.log("btnHome 标签被点击");
        },
        changeSearchWord : function(){
            console.log("searchWord 标签被点击" + searchWord.value);
        },
    }
}